package controller;

import model.Score;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import service.ScoreService;

import java.util.List;

@Controller
@RequestMapping("/Score")
public class ScoreController {
@Autowired
    ScoreService scoreService;
    @RequestMapping("list.do")
    public String list(Model model){
        List<Score> scores =scoreService.findAll();
        model.addAttribute("scores",scores);
        return "listScores";
    }
}
